<?php

class io
{
	public $get;
	public $session;
	public $cookie;
	
	public $output;
	public $model;
	
	private $_session;
	
	public function &getInstance()
	{
		static $in;
		
		if (!isset($in))
			$in = new io;
		
		return $in;
		
	} // end function
	
	function __construct()
	{
		foreach ($_GET AS $k => $v)
			$this->get[$k] = $v;
		
		foreach ($_SESSION AS $k => $v)
			$this->session[$k] = $v;
		
		$this->_session = $this->session;
		
		foreach ($_COOKIE AS $k => $v)
			$this->cookie[$k] = $v;
			
	} // end function
	
	public function save()
	{
		if ($this->_session != $this->session)
		{
			foreach ($this->session AS $k => $v)
				$_SESSION[$k] = $v;
				
		} // end if
		
	} // end function
	
} // end class

?>